<template>
  <Dialog title="详情" v-model="dialogVisible" width="80%" center>
    <UserInfo :user="user">
      <template #header>
        <div class="card-header">
          <CardTitle title="个人信息" />
        </div>
      </template>
    </UserInfo>
    <AuditsInfo :user="user" class="mt4">
      <template #header>
        <div class="card-header">
          <CardTitle title="审核信息" />
        </div>
      </template>
    </AuditsInfo>
  </Dialog>
</template>
<script setup lang="ts">
import * as MemberAvatarApi from '@/api/blind/memberAvatar'
import UserInfo from '../member/detail/UserInfo.vue'
import AuditsInfo from './components/AuditsInfo.vue'

const dialogVisible = ref(false) // 弹窗的是否展示
const user = ref<MemberAvatarApi.MemberUserVO>({} as MemberAvatarApi.MemberUserVO)

/** 打开弹窗 */
const open = async (id?: number) => {
  dialogVisible.value = true
  // 修改时，设置数据
  if (id) {
    user.value = await MemberAvatarApi.getMemberUser(id)
  }
}
defineExpose({ open }) // 提供 open 方法，用于打开弹
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
